<template>
  <div class="home">

    <div class="detail_box">

      <div class="operate_box">

        <div class="item_box">
          <time-filter @getTime="listenToChild" :type="1"></time-filter>
        </div>

      </div>

      <div style="display: flex;" v-if="isShow">
        <order :isUpdate="isUpdate" :proDate="proDate" :timeType="timeType" style="width: 50%"></order>
        <user :isUpdate="isUpdate" :proDate="proDate" :timeType="timeType" style="width: 50%"></user>
      </div>

      <div style="display: flex" v-if="isShow">
        <product :isUpdate="isUpdate" :proDate="proDate" :timeType="timeType" style="width:50%;"></product>
        <moneyData :isUpdate="isUpdate" :proDate="proDate" :timeType="timeType" style="width:50%;"></moneyData>
      </div>

    </div>
  </div>
</template>

<script>

import order from "./orderData";
import user from "./userData";
import product from "./productData";
import moneyData from "./moneyData";
import {getBtn} from "@/utils/btnAuth";
import timeFilter from "@/components/timeFilter"


export default {
  components: {
    order,
    user,
    product,
    moneyData,
    timeFilter
  },
  data() {
    return {
      user: '',
      userOption: [],
      keyword: '',
      currentPage: 1,
      pageSize: 15,
      totals: 0,
      loading: false,
      tableInfo: [],
      isPop: false,
      addressId: '',
      isChange: false,
      btn: {},
      timeIndex: 2,
      timeOptions: [{id: 1, name: '今天'}, {id: 2, name: '昨天'}, {id: 3, name: '本周'}, {id: 4, name: '上周'}, {
        id: 5,
        name: '本月'
      }, {id: 6, name: '上月'}],
      proDate: '',
      timeType: 2,
      isUpdate: 1,
      isShow: false
    }
  },
  mounted() {
  },
  methods: {
    //时间选择组件
    listenToChild(e) {
      if (e.date) {
        this.isShow = true;
        this.proDate = e.date;
        this.isUpdate = !this.isUpdate;
      }
    },

  }

}
</script>

<style scoped>
.time_btn {
  margin-right: 15px;
  border: 1px solid gainsboro;
}

.time_selected {
  margin-right: 15px;
  border: 1px solid #6687f9;
}
</style>
